home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Utilities / Installers / Smaller Installer 2.0.1 / Preinstalled version / Examples / Hook Procedure Examples / DemoHook / DemoHook.c next >
Encoding:
C/C++ Source or Header  |  1996-07-26  |  20.8 KB  |  679 lines  |  [TEXT/CWIE]

  1. /******************************************************************************
  2.     Smaller Installer © 1996 Bill Goodman, All Rights Reserved
  3. *******************************************************************************
  4.  
  5. Demonstration Hook Example
  6.  
  7. This is an example of an installer hook procedure. It displays an alert each
  8. time the hook procedure is called.
  9.  
  10. To build this hook procedure, compile this code and create a code resource
  11. (Type:SICR, ID:501, non-preloaded, nonpurgeable, unlocked, unprotected,
  12. non-sysheap). Add this resource to the "DemoHook.rsrc" file. Copy all the
  13. resources in "DemoHook.rsrc" to your installer's resource file.
  14.  
  15. ******************************************************************************/
  16.  
  17. // This file is compatible with version 2.1 of the universal headers
  18. #include <Dialogs.h>
  19. #include <Files.h>
  20. #include <TextUtils.h>
  21.  
  22. #ifdef __MWERKS__
  23. #include <A4Stuff.h>
  24. #endif
  25.  
  26. #ifdef THINK_C
  27. #include <SetUpA4.h>
  28. #endif
  29.  
  30. #include "SIHookProc.h"
  31.  
  32.  
  33. /******************************************************************************
  34.     Module Internal Function Prototypes
  35. ******************************************************************************/
  36. void AfterItemFunction(void);
  37. void BeforeItemFunction(void);
  38. void BeginOperationFunction(void);
  39. void BuildGroupStrings(StringPtr selGroupStr, StringPtr envGroupStr);
  40. void BuildItemString(StringPtr nameStr);
  41. void ChangeSelectionFunction(void);
  42. void EndOperationFunction(void);
  43. void FirstFunction(void);
  44. void GetDesDirName(StringPtr dirStr);
  45. void GetVolName(short vRefNum, StringPtr volStr);
  46. void LastFunction(void);
  47. void StrAppend(StringPtr srcStr, StringPtr desStr);
  48.  
  49.  
  50. /******************************************************************************
  51.     Constant Definitions
  52. ******************************************************************************/
  53. // Alert Definitions
  54. #define firstAlrt                        500    // Resource ID of First alert
  55. #define quit_firstAlrt                2        // Item number of QUIT button
  56.  
  57. #define lastAlrt                        501    // Resource ID of Last alert
  58.  
  59. #define changeAlrt                    502    // Resource ID of ChangeSelection alert
  60. #define quit_changeAlrt                2        // Item number of QUIT button
  61.  
  62. #define beginOpAlrt                    503    // Resource ID of BeginOperation alert
  63. #define abort_beginOpAlrt            2        // Item number of ABORT button
  64. #define quit_beginOpAlrt            3        // Item number of QUIT button
  65.  
  66. #define beforeItemAlrt                504    // Resource ID of BeforeItem alert
  67. #define skip_beforeItemAlrt        2        // Item number of SKIP button
  68. #define skipN_beforeItemAlrt        3        // Item number of ITEMDONE button
  69. #define abort_beforeItemAlrt        4        // Item number of ABORT button
  70. #define quit_beforeItemAlrt        5        // Item number of QUIT button
  71.  
  72. #define afterItemAlrt                505    // Resource ID of AfterItem alert
  73. #define abort_afterItemAlrt        2        // Item number of ABORT button
  74. #define quit_afterItemAlrt            3        // Item number of QUIT button
  75.  
  76. #define endOpAlrt                        506    // Resource ID of EndOperation alert
  77. #define abort_endOpAlrt                2        // Item number of ABORT button
  78. #define quit_endOpAlrt                3        // Item number of QUIT button
  79.  
  80.  
  81. /******************************************************************************
  82.     Module Variable Definitions
  83. ******************************************************************************/
  84. SIHookParmBlk *gParms;                    // Global pointer to parameter block
  85. unsigned char gEmptyStr[] = "\p";    // Global empty string
  86.  
  87.  
  88. /*****************************************************************************/
  89. pascal void main(
  90.         SIHookParmBlk *parmBlk    // Pointer to parameter block
  91.         )
  92. /******************************************************************************
  93.     This is the main entry point for the installer hook procedure.
  94. ******************************************************************************/
  95. {
  96. #ifdef __MWERKS__
  97. long holdA4;
  98. #endif
  99.  
  100. // Set up access to global variables
  101. #ifdef THINK_C
  102. RememberA0();
  103. SetUpA4();
  104. #endif
  105.  
  106. #ifdef __MWERKS__
  107. holdA4 = SetCurrentA4();
  108. #endif
  109.  
  110. gParms = parmBlk;
  111.  
  112. switch (gParms->function)
  113.     {
  114.     case siHookFirst:
  115.         FirstFunction();
  116.         break;
  117.  
  118.     case siHookLast:
  119.         LastFunction();
  120.         break;
  121.  
  122.     case siHookChangeSelection:
  123.         ChangeSelectionFunction();
  124.         break;
  125.  
  126.     case siHookBeginOperation:
  127.         BeginOperationFunction();
  128.         break;
  129.  
  130.     case siHookBeforeItem:
  131.         BeforeItemFunction();
  132.         break;
  133.  
  134.     case siHookAfterItem:
  135.         AfterItemFunction();
  136.         break;
  137.  
  138.     case siHookEndOperation:
  139.         EndOperationFunction();
  140.         break;
  141.     }
  142.  
  143. // Restore original A4 value
  144. #ifdef THINK_C
  145. RestoreA4();
  146. #endif
  147.  
  148. #ifdef __MWERKS__
  149. SetA4(holdA4);
  150. #endif
  151. }
  152.  
  153.  
  154. /*****************************************************************************/
  155. void FirstFunction(void)
  156. /******************************************************************************
  157.     Input parameters:
  158.         "targetVRefNum"    Volume reference number of target volume
  159.         "groupAPFlags"        Groups currently selected
  160.         "groupQUSel"
  161.         "groupVZSel"
  162.         "group32Flags"
  163.         "group64Flags"
  164.         "group96Flags"
  165.         "groupEnvironFlags"
  166.  
  167.     Returns:
  168.         "groupAPFlags"        Updated installation groups
  169.         "groupQUSel"
  170.         "groupVZSel"
  171.         "group32Flags"
  172.         "group64Flags"
  173.         "group96Flags"
  174.         "result"                Hook result code (siHookNoErr, siHookQuit)
  175.  
  176.     This function is called once when the installer is launched.
  177. ******************************************************************************/
  178. {
  179. Str255 volumeStr;
  180. Str255 selectedGroupsStr;
  181. Str255 environGroupsStr;
  182.  
  183. GetVolName(gParms->targetVRefNum, volumeStr);
  184. BuildGroupStrings(selectedGroupsStr, environGroupsStr);
  185.  
  186. // Display the target volume name and the selected groups in an alert
  187. ParamText(volumeStr, selectedGroupsStr, environGroupsStr, gEmptyStr);
  188. if (Alert(firstAlrt, NULL) == quit_firstAlrt)
  189.     gParms->result = siHookQuit;
  190. // Note that it is not necessary to set "result" if no error
  191. }
  192.  
  193.  
  194. /*****************************************************************************/
  195. void LastFunction(void)
  196. /******************************************************************************
  197.     Input parameters:
  198.         "targetVRefNum"    Volume reference number of target volume
  199.         "groupAPFlags"        Groups currently selected
  200.         "groupQUSel"
  201.         "groupVZSel"
  202.         "group32Flags"
  203.         "group64Flags"
  204.         "group96Flags"
  205.         "groupEnvironFlags"
  206.  
  207.     Returns:
  208.         Nothing
  209.  
  210.     This function is called once when the installer is terminating execution.
  211. ******************************************************************************/
  212. {
  213. Str255 volumeStr;
  214. Str255 selectedGroupsStr;
  215. Str255 environGroupsStr;
  216.  
  217. GetVolName(gParms->targetVRefNum, volumeStr);
  218. BuildGroupStrings(selectedGroupsStr, environGroupsStr);
  219.  
  220. // Display the target volume name and the selected groups in an alert
  221. ParamText(volumeStr, selectedGroupsStr, environGroupsStr, gEmptyStr);
  222. Alert(lastAlrt, NULL);
  223. }
  224.  
  225.  
  226. /*****************************************************************************/
  227. void ChangeSelectionFunction(void)
  228. /******************************************************************************
  229.     Input parameters:
  230.         "targetVRefNum"    Volume reference number of target volume
  231.         "groupAPFlags"        Groups currently selected
  232.         "groupQUSel"
  233.         "groupVZSel"
  234.         "group32Flags"
  235.         "group64Flags"
  236.         "group96Flags"
  237.         "groupEnvironFlags"
  238.  
  239.     Returns:
  240.         "groupAPFlags"        Updated installation groups
  241.         "groupQUSel"
  242.         "groupVZSel"
  243.         "group32Flags"
  244.         "group64Flags"
  245.         "group96Flags"
  246.         "result"                Hook result code (siHookNoErr, siHookQuit)
  247.  
  248.     This function is called whenever the target volume or group selections are
  249.     changed.
  250. ******************************************************************************/
  251. {
  252. Str255 volumeStr;
  253. Str255 selectedGroupsStr;
  254. Str255 environGroupsStr;
  255.  
  256. GetVolName(gParms->targetVRefNum, volumeStr);
  257. BuildGroupStrings(selectedGroupsStr, environGroupsStr);
  258.  
  259. // Display the target volume name and the selected groups in an alert
  260. ParamText(volumeStr, selectedGroupsStr, environGroupsStr, gEmptyStr);
  261. if (Alert(changeAlrt, NULL) == quit_changeAlrt)
  262.     gParms->result = siHookQuit;
  263. }
  264.  
  265.  
  266. /*****************************************************************************/
  267. void BeginOperationFunction(void)
  268. /******************************************************************************
  269.     Input parameters:
  270.         "targetVRefNum"    Volume reference number of target volume
  271.         "groupAPFlags"        Groups currently selected
  272.         "groupQUSel"
  273.         "groupVZSel"
  274.         "group32Flags"
  275.         "group64Flags"
  276.         "group96Flags"
  277.         "groupEnvironFlags"
  278.         "passwordPtr"        Pointer to password string
  279.         "filesRemaining"    Number of files remaining to install or remove
  280.         "bytesRemaining"    Number of bytes of data remaining to install or remove
  281.         "doingRemove"        Non-zero if doing remove operation
  282.  
  283.     Returns:
  284.         "passwordPtr"        Pointer to password string
  285.         "result"                Hook result code (siHookNoErr, siHookQuit, siHookAbort)
  286.  
  287.     This function is called when the install button or the remove button is
  288.     clicked to begin installing or removing files.
  289. ******************************************************************************/
  290. {
  291. Str255 volumeStr;
  292. Str255 selectedGroupsStr;
  293. Str255 environGroupsStr;
  294. Str255 statusStr;
  295.  
  296. GetVolName(gParms->targetVRefNum, volumeStr);
  297. BuildGroupStrings(selectedGroupsStr, environGroupsStr);
  298.  
  299. // Build status string
  300. statusStr[0] = 0;
  301. StrAppend("\pDoingRemove:  ", statusStr);
  302. StrAppend(gParms->doingRemove ? "\pTRUE" : "\pFALSE", statusStr);
  303.  
  304. // Display the target volume name, the selected groups and "doingRemove" in an
  305. // alert
  306. ParamText(volumeStr, selectedGroupsStr, environGroupsStr, statusStr);
  307. switch (Alert(beginOpAlrt, NULL))
  308.     {
  309.     case abort_beginOpAlrt:
  310.         gParms->result = siHookAbort;
  311.         break;
  312.  
  313.     case quit_beginOpAlrt:
  314.         gParms->result = siHookQuit;
  315.         break;
  316.     }
  317. }
  318.  
  319.  
  320. /*****************************************************************************/
  321. void BeforeItemFunction(void)
  322. /******************************************************************************
  323.     Input parameters:
  324.         "targetVRefNum"    Volume reference number of target volume
  325.         "groupAPFlags"        Groups currently selected
  326.         "groupQUSel"
  327.         "groupVZSel"
  328.         "group32Flags"
  329.         "group64Flags"
  330.         "group96Flags"
  331.         "groupEnvironFlags"
  332.         "filesRemaining"    Number of files remaining to install or remove
  333.         "bytesRemaining"    Number of bytes of data remaining to install or remove
  334.         "doingRemove"        Non-zero if doing remove operation
  335.         "anyItemsSkipped"    Non-zero if any item has been skipped during operation
  336.         "desVRefNum"        Volume reference number of destination volume
  337.         "desDirID"            Directory ID of destination directory
  338.         "itemName"            Name of item to install or remove
  339.         "itemIsFolder"        Non-zero if item is a folder
  340.         "fileType"            File type (files only)
  341.         "fileCreator"        File creator (files only)
  342.         "createDate"        Creation date (files only)
  343.         "lastModDate"        Last modification date (files only)
  344.         "rsrcForkLen"        Length of resource fork (files only)
  345.         "dataForkLen"        Length of data fork (files only)
  346.  
  347.     Returns:
  348.         "result"                Hook result code (siHookNoErr, siHookQuit, siHookAbort, siHookSkip, siHookItemDone)
  349.         "desDirID"            Directory ID of destination directory
  350.         "itemName"            Name of item to install or remove
  351.         "itemInfo"            Reference passed to AfterItem call
  352.  
  353.     This function is called before each item is installed or removed.
  354. ******************************************************************************/
  355. {
  356. Str255 volumeStr;
  357. Str255 dirStr;
  358. Str255 itemStr;
  359. Str255 statusStr;
  360.  
  361. GetVolName(gParms->desVRefNum, volumeStr);
  362. GetDesDirName(dirStr);
  363. BuildItemString(itemStr);
  364.  
  365. // Build status string
  366. statusStr[0] = 0;
  367. StrAppend("\pDoingRemove:  ", statusStr);
  368. StrAppend(gParms->doingRemove ? "\pTRUE\r" : "\pFALSE\r", statusStr);
  369. StrAppend("\pAnyItemsSkipped:  ", statusStr);
  370. StrAppend(gParms->anyItemsSkipped ? "\pTRUE" : "\pFALSE", statusStr);
  371.  
  372. // Display the destination volume name, destination directory name, item name,
  373. // "doingRemove" and "anyItemsSkipped" in an alert.
  374. ParamText(volumeStr, dirStr, itemStr, statusStr);
  375. switch (Alert(beforeItemAlrt, NULL))
  376.     {
  377.     case skip_beforeItemAlrt:
  378.         gParms->result = siHookSkip;
  379.         break;
  380.  
  381.     case skipN_beforeItemAlrt:
  382.         gParms->result = siHookItemDone;
  383.         break;
  384.  
  385.     case abort_beforeItemAlrt:
  386.         gParms->result = siHookAbort;
  387.         break;
  388.  
  389.     case quit_beforeItemAlrt:
  390.         gParms->result = siHookQuit;
  391.         break;
  392.     }
  393. }
  394.  
  395.  
  396. /*****************************************************************************/
  397. void AfterItemFunction(void)
  398. /******************************************************************************
  399.     Input parameters:
  400.         "targetVRefNum"    Volume reference number of target volume
  401.         "groupAPFlags"        Groups currently selected
  402.         "groupQUSel"
  403.         "groupVZSel"
  404.         "group32Flags"
  405.         "group64Flags"
  406.         "group96Flags"
  407.         "groupEnvironFlags"
  408.         "filesRemaining"    Number of files remaining to install or remove
  409.         "bytesRemaining"    Number of bytes of data remaining to install or remove
  410.         "doingRemove"        Non-zero if doing remove operation
  411.         "anyItemsSkipped"    Non-zero if any item has been skipped during operation
  412.         "itemWasSkipped"    Non-zero if this item was skipped
  413.         "desVRefNum"        Volume reference number of destination volume
  414.         "desDirID"            Directory ID of destination directory
  415.         "itemName"            Name of item that was installed or removed
  416.         "itemIsFolder"        Non-zero if item is a folder
  417.         "fileType"            File type (files only)
  418.         "fileCreator"        File creator (files only)
  419.         "createDate"        Creation date (files only)
  420.         "lastModDate"        Last modification date (files only)
  421.         "rsrcForkLen"        Length of resource fork (files only)
  422.         "dataForkLen"        Length of data fork (files only)
  423.         "itemInfo"            Reference passed from BeforeItem call
  424.  
  425.     Returns:
  426.         "result"                Hook result code (siHookNoErr, siHookQuit, siHookAbort)
  427.  
  428.     This function is called after each item is installed or removed.
  429. ******************************************************************************/
  430. {
  431. Str255 volumeStr;
  432. Str255 dirStr;
  433. Str255 itemStr;
  434. Str255 statusStr;
  435.  
  436. GetVolName(gParms->desVRefNum, volumeStr);
  437. GetDesDirName(dirStr);
  438. BuildItemString(itemStr);
  439.  
  440. // Build status string
  441. statusStr[0] = 0;
  442. StrAppend("\pDoingRemove:  ", statusStr);
  443. StrAppend(gParms->doingRemove ? "\pTRUE\r" : "\pFALSE\r", statusStr);
  444. StrAppend("\pAnyItemsSkipped:  ", statusStr);
  445. StrAppend(gParms->anyItemsSkipped ? "\pTRUE\r" : "\pFALSE\r", statusStr);
  446. StrAppend("\pItemWasSkipped:  ", statusStr);
  447. StrAppend(gParms->itemWasSkipped ? "\pTRUE" : "\pFALSE", statusStr);
  448.  
  449. // Display the destination volume name, destination directory name, item name,
  450. // "doingRemove", "anyItemsSkipped" and "itemWasSkipped" in an alert.
  451. ParamText(volumeStr, dirStr, itemStr, statusStr);
  452. switch (Alert(afterItemAlrt, NULL))
  453.     {
  454.     case abort_afterItemAlrt:
  455.         gParms->result = siHookAbort;
  456.         break;
  457.  
  458.     case quit_afterItemAlrt:
  459.         gParms->result = siHookQuit;
  460.         break;
  461.     }
  462. }
  463.  
  464.  
  465. /*****************************************************************************/
  466. void EndOperationFunction(void)
  467. /******************************************************************************
  468.     Input parameters:
  469.         "targetVRefNum"    Volume reference number of target volume
  470.         "groupAPFlags"        Groups currently selected
  471.         "groupQUSel"
  472.         "groupVZSel"
  473.         "group32Flags"
  474.         "group64Flags"
  475.         "group96Flags"
  476.         "groupEnvironFlags"
  477.         "filesRemaining"    Number of files remaining to install or remove
  478.         "bytesRemaining"    Number of bytes of data remaining to install or remove
  479.         "doingRemove"        Non-zero if doing remove operation
  480.         "anyItemsSkipped"    Non-zero if any item has been skipped during operation
  481.         "aborted"            Non-zero if operation was aborted
  482.  
  483.     Returns:
  484.         "result"                Hook result code (siHookNoErr, siHookQuit, siHookAbort)
  485.  
  486.     This function is called at the end of the install or remove operation.
  487. ******************************************************************************/
  488. {
  489. Str255 volumeStr;
  490. Str255 selectedGroupsStr;
  491. Str255 environGroupsStr;
  492. Str255 statusStr;
  493.  
  494. GetVolName(gParms->targetVRefNum, volumeStr);
  495. BuildGroupStrings(selectedGroupsStr, environGroupsStr);
  496.  
  497. // Build status string
  498. statusStr[0] = 0;
  499. StrAppend("\pDoingRemove:  ", statusStr);
  500. StrAppend(gParms->doingRemove ? "\pTRUE\r" : "\pFALSE\r", statusStr);
  501. StrAppend("\pAnyItemsSkipped:  ", statusStr);
  502. StrAppend(gParms->anyItemsSkipped ? "\pTRUE\r" : "\pFALSE\r", statusStr);
  503. StrAppend("\pAborted:  ", statusStr);
  504. StrAppend(gParms->aborted ? "\pTRUE" : "\pFALSE", statusStr);
  505.  
  506. // Display the target volume name, the selected groups, "doingRemove",
  507. // "anyItemsSkipped" and "aborted" in an alert
  508. ParamText(volumeStr, selectedGroupsStr, environGroupsStr, statusStr);
  509. switch (Alert(endOpAlrt, NULL))
  510.     {
  511.     case abort_endOpAlrt:
  512.         gParms->result = siHookAbort;
  513.         break;
  514.  
  515.     case quit_endOpAlrt:
  516.         gParms->result = siHookQuit;
  517.         break;
  518.     }
  519. }
  520.  
  521.  
  522. /*****************************************************************************/
  523. void GetVolName(
  524.         short vRefNum,        // Source volume reference number
  525.         StringPtr volStr    // Returned volume name string
  526.         )
  527. /******************************************************************************
  528.     Get name of specified volume and return in the specified string.
  529. ******************************************************************************/
  530. {
  531. HParamBlockRec pb;
  532.  
  533. pb.volumeParam.ioVRefNum = vRefNum;
  534. pb.volumeParam.ioNamePtr = volStr;
  535. pb.volumeParam.ioVolIndex = 0;
  536. if (PBHGetVInfoSync(&pb))
  537.     volStr[0] = 0;
  538. }
  539.  
  540.  
  541. /*****************************************************************************/
  542. void GetDesDirName(
  543.         StringPtr dirStr    // Returned folder name string
  544.         )
  545. /******************************************************************************
  546.     Get name of folder specified in "desVRefNum/desDirID" and return in
  547.     the specified string.
  548. ******************************************************************************/
  549. {
  550. CInfoPBRec ib;
  551.  
  552. ib.dirInfo.ioVRefNum = gParms->desVRefNum;
  553. ib.dirInfo.ioDrDirID = gParms->desDirID;
  554. ib.dirInfo.ioNamePtr = dirStr;
  555. ib.dirInfo.ioFDirIndex = -1;
  556. if (PBGetCatInfoSync(&ib))
  557.     dirStr[0] = 0;
  558. }
  559.  
  560.  
  561. /*****************************************************************************/
  562. void BuildItemString(
  563.         StringPtr nameStr    // Returned item string
  564.         )
  565. /******************************************************************************
  566.     Return the item name and type in the specified string.
  567. ******************************************************************************/
  568. {
  569. nameStr[0] = 0;
  570. StrAppend(gParms->itemIsFolder ? "\p(folder)  “" : "\p(file)  “", nameStr);
  571. StrAppend(gParms->itemName, nameStr);
  572. StrAppend("\p”", nameStr);
  573. }
  574.  
  575.  
  576. /*****************************************************************************/
  577. void BuildGroupStrings(
  578.         StringPtr selGroupStr,    // Returned selected groups string
  579.         StringPtr envGroupStr    // Returned environment groups string
  580.         )
  581. /******************************************************************************
  582.     Build a list of selected groups and a list of environment groups. Return
  583.     the lists in the specified strings.
  584. ******************************************************************************/
  585. {
  586. short index;
  587. short count;
  588. short groupNum;
  589. unsigned long flags;
  590. Str255 tmpStr;
  591.  
  592. ///// Build selected groups string /////
  593. index = 0;
  594. for (count = 0; count <= 15; count++)
  595.     {
  596.     if (gParms->groupAPFlags & (0x0001 << count))
  597.         {    // Group is selected - add to list
  598.         selGroupStr[++index] = 'A' + count;
  599.         selGroupStr[++index] = '/';
  600.         }
  601.     }
  602. selGroupStr[++index] = 'Q' + gParms->groupQUSel;
  603. selGroupStr[++index] = '/';
  604. selGroupStr[++index] = 'V' + gParms->groupVZSel;
  605.  
  606. for (groupNum = 1; groupNum <= 96; groupNum++)
  607.     {
  608.     if (groupNum <= 32)
  609.         flags = gParms->group32Flags;
  610.     else if (groupNum <= 64)
  611.         flags = gParms->group64Flags;
  612.     else
  613.         flags = gParms->group96Flags;
  614.     if (flags & (0x00000001L << ((groupNum - 1) & 0x1F)))
  615.         {    // Group is selected - add to list
  616.         if (index > 40)
  617.             {    // Max string length exceeded - truncate
  618.             selGroupStr[++index] = '…';
  619.             break;
  620.             }
  621.         selGroupStr[++index] = '/';
  622.         NumToString(groupNum, tmpStr);
  623.         selGroupStr[++index] = tmpStr[1];
  624.         if (tmpStr[0] > 1)
  625.             selGroupStr[++index] = tmpStr[2];
  626.         }
  627.     }
  628. selGroupStr[0] = index;
  629.  
  630. ///// Build environment groups string /////
  631. envGroupStr[0] = 0;
  632.  
  633. // Set monitor type
  634. if (gParms->groupEnvironFlags & siHookEnvBlackAndWhite)
  635.     StrAppend("\pB&W", envGroupStr);
  636. if (gParms->groupEnvironFlags & siHookEnvColor)
  637.     StrAppend("\pColor", envGroupStr);
  638.  
  639. // Set processor type
  640. if (gParms->groupEnvironFlags & siHookEnv68KProcessor)
  641.     StrAppend("\p/68K-Mac", envGroupStr);
  642. if (gParms->groupEnvironFlags & siHookEnvPPCProcessor)
  643.     StrAppend("\p/PowerMac", envGroupStr);
  644.  
  645. // Set FPU
  646. if (gParms->groupEnvironFlags & siHookEnv68KWithFPU)
  647.     StrAppend("\p/FPU", envGroupStr);
  648. if (gParms->groupEnvironFlags & siHookEnv68KWithoutFPU)
  649.     StrAppend("\p/NoFPU", envGroupStr);
  650.  
  651. // Set system version
  652. if (gParms->groupEnvironFlags & siHookEnvSystem6OrLower)
  653.     StrAppend("\p/Sys-6", envGroupStr);
  654. if (gParms->groupEnvironFlags & siHookEnvSystem7OrHigher)
  655.     StrAppend("\p/Sys-7", envGroupStr);
  656.  
  657. // Set fat install type
  658. if (gParms->groupEnvironFlags & siHookEnvInstallFat)
  659.     StrAppend("\p/Fat", envGroupStr);
  660. if (gParms->groupEnvironFlags & siHookEnvInstall68KOnly)
  661.     StrAppend("\p/68K-only", envGroupStr);
  662. if (gParms->groupEnvironFlags & siHookEnvInstallPPCOnly)
  663.     StrAppend("\p/PPC-only", envGroupStr);
  664. }
  665.  
  666.  
  667. /*****************************************************************************/
  668. void StrAppend(
  669.         StringPtr srcStr,    // Source string
  670.         StringPtr desStr    // Destination string
  671.         )
  672. /******************************************************************************
  673.     Append the characters in the source string to the destination string.
  674. ******************************************************************************/
  675. {
  676. BlockMove(&srcStr[1], &desStr[desStr[0] + 1], srcStr[0]);
  677. desStr[0] += srcStr[0];
  678. }
  679.